package org.springblade.modules.admin.task;

import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * @author Jackey
 * @date 2023年01月06日 11:45
 */
@Component
public class TestXxlJob {

	private Logger log = LoggerFactory.getLogger(TestXxlJob.class);

	@XxlJob(value = "testJobHandler")
	public void execute(){


		log.info("测试job execute 任务方法[调度]成功");

		//获取参数
		String jobParam = XxlJobHelper.getJobParam();
		log.info("param:" + jobParam);

		//XXL-JOB 平台日志
		XxlJobHelper.log("xxlJob执行日志: param=" + jobParam);

		//如果业务方法成功,调用执行成功
		XxlJobHelper.handleSuccess("[执行]成功");
		//如果业务方法成功,调用执行成功
//		XxlJobHelper.handleFail("[执行]失败");
	}
}
